<div class="referbox">
      <div class="goods-discus-title">
       <div class="floatright"><a href="#write_ask" class="orangebtn allnum"><i class="has-icon"> <img  style="margin:0"src='<{$env.app.res_url}>/bundle/pencil.gif' /></i><span>我要咨询</span></a></div>
    </div>
      <div class="consult">
    <{if $gask_type}>  	
	<ul class="consult_list clearfix">
	 <li class="active active_type"><{t}>全部咨询<{/t}><span>(<em><{$comment.askCount|default:'0'}></em>条)</span>
	<{foreach from=$gask_type item="gask_type1"}>
    <li class="active_type"><{$gask_type1.name}><span>(<em><{$gask_type1.total}></em>条)</span>
    <input type="hidden" value='<{$gask_type1.type_id}>'>
    </li>
    <{/foreach}>
	</ul>
	<{/if}>
<div class="goods-discus-title"> <{t}>共<{/t}><span class="fontcolorRed"><{$comment.askCount|default:'0'}></span><{t}>人咨询<{/t}>&nbsp;&nbsp;<span class="all_link"><a href="#ask_all_info" class="allnum" style=" color:#367EC1"><{t}>查看所有咨询<{/t}></a> </span></div>
<div class="consult-content">
	<a name="ask_all_info"></a>
    <div class="consult-panel" id="consult_content"><{include file="site/product/consult_content.html"}></div>
</div>
</div>
<div style="display:none" class="displaydiv">
 <a name="write_ask"></a>
  <form class="addcomment" method="post" action='<{link app=b2c ctl=site_comment act=toComment arg0=$goods.goods_id arg1=ask}>' onsubmit='checkFormReqs(event);'>
      <h4><{t}>发表咨询<{/t}></h4>
      <div class="consult_cont">
      <div class="division">
      	<div class="leftbox">
        <ul>
		<{if $gask_type}>
          <li><{t}>咨询类型 : <{/t}>
            <{foreach from=$gask_type item="gask_type"}>
              <{$gask_type.name}><input type="radio" <{if $gask_type.type_id == 1}>checked="checked"<{/if}> value="<{$gask_type.type_id}>" name="gask_type" />
              <{/foreach}>
          </li>
		  <{/if}>
          <li>
           <{input type="textarea" class="inputstyle"  vtype="sendcomments" rows="5" name="comment" style="display:block;width:80%;"}>
              <span class="infotips"><{t}>字数限制为5-200个<{/t}></span>
              <script>
	                window.addEvent('domready',function(){
	                    validatorMap.set('sendcomments', ['<{t}>咨询的字数应该在5-200个字之内<{/t}>', function(element, v) {
	                        if ($(element).getValue() == '' || $(element).getValue().length < 5 || $(element).getValue().length >= 200){
	                            return false;
	                        }
	                        else
	                            return true;
	                    }]);
	                });
	            </script>
          </li>
          <{if $login eq "nologin"}>
          <li>
            <{t}>联系方式：<{/t}>
            <{input type="text" vtype=required class="inputstyle"   size=20 name="contact"}><span class="infotips"><{t}>(可以是电话、email、qq等)<{/t}></span>
          </li>
          <{/if}>
          <{if $askshow == "on"}>
          <li>
            <{t}>验证码：<{/t}>
            <{input type="number" vtype=required size="4" maxlength="4" name="askverifyCode"}>&nbsp;<img src="<{link app="b2c" ctl="site_comment" act="gen_askvcode" arg0=$smarty.now}>" border="1" id="askimgVerifyCode"/><a href="javascript:changeimg('askimgVerifyCode','ask')">&nbsp;<{t}>看不清楚?换个图片<{/t}></a>
          </li>
          <{/if}>
          <{if $login != "nologin"}>
          <li>
            <{t}>匿名发表:<{/t}>
            <input type="checkbox" name="hidden_name" value="YES"/>
          </li>
          <{/if}>
          <li>
           <!--<input type="submit" value="<{t}>提交咨询<{/t}>">-->
              <button id="cart-coupon-submitBtn" class="btn dicusbtn " type="submit"> <span><span> <{t}>提交咨询<{/t}></span></span> </button>
          </li>
        </ul>
        </div>
         <div class="rightbox"><p><{$comment.submit_comment_notice.ask}></p>
</div>
<div class="clear"></div>
      </div>
      </div>
    </form>
    </div>
    
      </div>
      
<script>
(function(){
	$$('.active_type').addEvent('click',function(){
		if(this.hasClass('active')) return ;
		this.removeClass('active_type');
		if($$('.consult_list .active')[0])$$('.consult_list .active')[0].removeClass('active');
		this.addClass('active');
		var type_id = '';
		if(this.getFirst('input')) type_id = this.getFirst('input').value;
		 new Request.HTML({
		  url:'<{link app="b2c" ctl="site_comment" act="ajax_type_ask"}>',
		  update:$('consult_content'),method:'post',
		  data:'goods_id=<{$goods.goods_id}>&type_id='+type_id
	  }).send();
	});
})();
</script>